package com.yhd.gmall.item.controller;

import com.yhd.gmall.common.result.Result;
import com.yhd.gmall.item.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yhd
 * @createtime 2020/9/22 9:48
 */
@RestController
@RequestMapping("api/item")
public class ItemController {

    @Autowired
    private ItemService itemService;

    @GetMapping("{skuId}")
    public Result getSkuInfo(@PathVariable("skuId") Long skuId){
        return Result.ok(itemService.getBySkuId(skuId));
    }

}
